On its surface Event Driven Architecture and Event sourcing have many overlapping functions and characteristics. However, essential differences exists which need to be taken into consideration. Mixing the two patterns without thoughtful consideration could lead to an architecture that has an high load of published and distributed events, and a lack of ownership and agility.
As described by Pablo Iorio the following comparison can be made.
Aspects | Event sourcing | Event-Driven architecture |
---|---|---|
Purpose | Keeping history | Highly adaptable and scalable |
Scope | Single application/system | Whole organisation/several apps |
Storage | Central event store | Decentralised |
Testing | Easier | Harder |
Event sourcing is an alternative to traditional persistence strategies, with the purpose of keeping history. Event driven architecture is a distributed asynchronous architecture pattern used to produce highly scalable applications. In other words, event sourcing is about having historical records in an organisation, whereas EDAs are highly adaptable, scalable and can be used for small applications and as well as large, complex ones.
Event sourcing is usually applied in a single application/system, maybe implemented as services; however usually sharing the same storage. Meanwhile, EDAs are used across several apps/systems. Being a reliable integration pattern to achieve high levels of agility to respond quickly to a constantly changing environment.
Event sourcing has a central event store, which usually has replicas, sharding, etc. It relies on a central database. By contrast, EDAs are distributed so each component (or event processors) is decoupled and most likely to have their own storage.
Event sourcing is easier to test in comparison, since it can replay the whole sequence of events from scratch to arrive to a certain state/situation. On the other hand, EDAs are easy to test for each component in isolation, however testing the whole is complicated by the asynchronous nature of this pattern.
Source: Pablo Iorio